# Created with pycharm
# author:ju bai
# Date:2021/8/7
# Time:11:06
from selenium import webdriver
import time
import unittest


class blogTest(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Chrome()
        self.url = "http://1.117.168.80:8080/practice/log.html"
        self.driver.maximize_window()
        time.sleep(3)

    def tearDown(self):
        self.driver.quit()

    def test_login(self):
        driver = self.driver
        url = self.url
        driver.get(url)
        driver.find_element_by_id("username").send_keys("admin")
        driver.find_element_by_id("password").send_keys("123")
        driver.find_element_by_xpath("/html/body/div/input[3]").click()
        time.sleep(3)

    if __name__ == "__main__":
        unittest.main()
